<style lang="scss" scoped>
.dashboard {
  position: absolute;
  margin: auto;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 1920px;
  height: 1080px;
  // 修改最上面lop图片
  background: url("../assets/img/newlogo.png") top no-repeat;
  background-size: contain;
  // background: url("../assets/img/logo.png") top no-repeat;
  & > div {
    position: absolute;
    // border: solid 1px rgba(255, 255, 255, 0.2);
  }
}

.title {
  top: 50px;
  left: 30px;
  font-size: 40px;
  color: white;
}
.bg-title {
  position: absolute;
  // top: 48px;
  top: 34px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 464px;
  height: 26px;
  font-size: 35px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  color: #fff;
}

.realtime {
  top: 93px;
  left: 32px;
  width: 450px;
  height: 311px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.subitem {
  top: 429px;
  left: 32px;
  width: 450px;
  height: 272px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
  span {
    position: absolute;
    font-size: 16px;
    color: #fff;
    z-index: 999;
    top: 58%;
    left: 46%;
  }
}

.save {
  left: 32px;
  top: 726px;
  width: 450px;
  height: 325px;
}
.title-box {
  left: 501px;
  width: 911px;
  margin-top: 130px;
  height: 58px;
  display: flex;
}
.title-center {
  display: flex;
  position: relative;
  // background-color: #fff;
  flex: 1;
  // margin: 3px 3px;
  // justify-content: space-between;
  font-size: 20px;
  font-family: YouSheBiaoTiHei;
  font-weight: 400;
  text-align: center;
  // color: #48eaff;
  color: #fff;
  // text-align: center;
  margin: 0 4px;
}
.title-center .ly-tz {
  flex: 1;
  text-align: center;
  line-height: -58px;
  // background-color: #fff;
}

.panel-hight {
  a {
    color: #48eaff;
  }
  position: relative;
  border: 6px solid transparent;
  border-width: 14px;
  border-image-source: url("../assets/img/title-hight.png");
  border-image-slice: 16;
}

// .map {
//   left: 550px;
//   top: 152px;
//   width: 850px;
//   height: 715px;
// }
.statistics {
  left: 498px;
  top: 774px;
  width: 924px;
  height: 277px;
}
.statistics-top {
  justify-content: center;
  align-items: center;
  display: flex;
  .statistics-bott {
    display: flex;
    flex-direction: column;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex: 1;

    p {
      color: #48eaff;
      font-size: 16px;
      margin: 12px 0 13px 0;
    }
  }
  .statistics-bott img {
    top: 855px;
    width: 86px;
    height: 99px;
    margin-top: 35px;
  }
}
.zhong {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
  span {
    font-size: 16px;
    color: #dbefff;
    margin: 5px 0 9px 0;
  }
  i {
    color: #48eaff;
    font-size: 16px;
    font-style: normal;
    font-family: Microsoft JhengHei UI;
  }
}

.warning {
  left: 1444px;
  top: 93px;
  width: 450px;
  height: 315px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}

.conform {
  top: 431px;
  left: 1444px;
  width: 450px;
  height: 270px;
  // border: solid 1px rgba(255, 255, 255, 0.2);
}
.conform-bott {
  width: 100%;
  height: 100%;
  display: flex;
  p {
    margin: 0;
  }
}
.conform-left {
  position: relative;
  flex: 1;
  // transform: rotate(150deg);
  .conform-left-num {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-size: 32px;
  }
  .conform-le-radius {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translateX(-50%);
    color: #040c3e;
    font-size: 14px;
    width: 50px;
    height: 25px;
    background: #4ffffc;
    border: 2px solid #4ffffc;
    border-radius: 10px;
  }
  .conform-le-txt {
    position: absolute;
    left: 50%;
    top: 75%;
    transform: translateX(-50%);
    width: 68px;
    height: 31px;
    font-size: 14px;
    font-family: Microsoft JhengHei UI;
    font-weight: bold;
    color: #ffffff;
  }
}
.conform-right {
  position: relative;
  flex: 1;
  // transform: rotate(150deg);
  .conform-right-num {
    z-index: 2;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    font-size: 32px;
  }
  .conform-ri-radius {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translateX(-50%);
    color: #040c3e;
    font-size: 14px;
    width: 50px;
    height: 25px;
    background: #4ffffc;
    border: 2px solid #4ffffc;
    border-radius: 10px;
  }
  .conform-ri-txt {
    position: absolute;
    left: 50%;
    top: 75%;
    transform: translateX(-50%);
    width: 68px;
    height: 35px;
    font-size: 14px;
    font-family: Microsoft JhengHei UI;
    font-weight: bold;
    color: #ffffff;
    // line-height: 19px;
  }
}

.forecast {
  left: 1444px;
  top: 727px;
  width: 450px;
  height: 324px;
}
</style>
<template>
  <div class="dashboard">
    <div class="bg-title">星云智慧园</div>
    <!-- 实时用电监控区域 -->
    <div class="realtime panel1">
      <div class="public">实时用电监控</div>
      <realtime></realtime>
    </div>
    <!-- 分项用电统计 -->
    <div class="subitem panel1">
      <div class="public">分项用电统计</div>
      <span>Mvh</span>
      <subitem></subitem>
    </div>
    <!-- 月度节电统计 -->
    <div class="save panel1">
      <div class="public">月度节电统计</div>
      <save></save>
    </div>
    <div class="line-y-ca"></div>
    <div class="title-box">
      <div
        class="panel-title title-center"
        :class="activeClass == index ? 'panel-hight' : ''"
        v-for="(item, index) in itemList"
        :key="index"
        @click="getItem(index)"
      >
        <router-link :to="item.link" class="ly-tz">{{ item.name }}</router-link>
      </div>
    </div>
    <div class="map">
      <!-- <Map></Map> -->
    </div>
    <!-- 能耗统计 -->
    <div class="statistics panel1">
      <div class="public">能耗统计</div>
      <div class="statistics-top">
        <div class="statistics-bott">
          <img src="../assets/img/lei.png" alt="" />
          <p>耗电量</p>
          <div class="zhong">
            <span>当日:</span>
            <div class="public-font">13.66<i>Mvh</i></div>
          </div>
          <div class="zhong">
            <span>当月:</span>
            <div class="public-font">350.1<i>Mwh</i></div>
          </div>
        </div>
        <div class="statistics-bott">
          <img src="../assets/img/xue.png" alt="" />
          <p>耗冷量</p>
          <div class="zhong">
            <span>当日:</span>
            <div class="public-font">5117<i>GJ</i></div>
          </div>
          <div class="zhong">
            <span>当月:</span>
            <div class="public-font">153.5<i>PJ</i></div>
          </div>
        </div>
        <div class="statistics-bott">
          <img src="../assets/img/icon.png" alt="" />
          <p>耗水量</p>
          <div class="zhong">
            <span>当日:</span>
            <div class="public-font">
              241.3<i
                >m<SUP><font style="font-size: 12px">3</font></SUP></i
              >
            </div>
          </div>
          <div class="zhong">
            <span>当月:</span>
            <div class="public-font">
              7238<i
                >m<SUP><font style="font-size: 12px">3</font></SUP></i
              >
            </div>
          </div>
        </div>
        <div class="statistics-bott">
          <img src="../assets/img/qi.png" alt="" />
          <p>耗气量</p>
          <div class="zhong">
            <span>当日:</span>
            <div class="public-font">
              277.8<i
                >m<SUP><font style="font-size: 12px">3</font></SUP></i
              >
            </div>
          </div>
          <div class="zhong">
            <span>当月:</span>
            <div class="public-font">
              8336<i
                >m<SUP><font style="font-size: 12px">3</font></SUP></i
              >
            </div>
          </div>
        </div>
      </div>
      <!-- <bar></bar> -->
    </div>
    <!-- 告警统计 -->
    <div class="warning panel1">
      <div class="public">告警统计</div>
      <emergency></emergency>
    </div>
    <!-- 需量符合度 -->
    <div class="conform panel1">
      <div class="public">需量符合度</div>
      <div class="conform-bott">
        <div class="conform-left">
          <div class="public-font conform-left-num">95</div>
          <div class="conform-le-radius">达标</div>
          <div class="conform-le-txt">
            <span>本月</span>
            <p>达标值95</p>
          </div>
          <conform1></conform1>
        </div>
        <div class="conform-right">
          <div class="public-font conform-right-num">91</div>
          <div class="conform-ri-radius">达标</div>
          <div class="conform-ri-txt">
            <span>上月</span>
            <p>达标值91</p>
          </div>
          <conform></conform>
        </div>
      </div>
    </div>
    <!-- 需量预测 -->
    <div class="forecast panel1">
      <div class="public">需量预测</div>
      <forecast></forecast>
    </div>
  </div>
</template>

<script>
import realtime from "@/components/charts/realtime";
import subitem from "@/components/charts/subitem";
import save from "@/components/charts/save";
import emergency from "@/components/charts/emergency";
import conform from "@/components/charts/conform";
import conform1 from "@/components/charts/conform1";
import forecast from "@/components/charts/forecast";
import Map from "@/components/charts/Map";
// import Bar from "@/components/charts/Bar";

export default {
  name: "Nhgl",
  components: {
    realtime,
    subitem,
    save,
    Map,
    emergency,
    conform,
    conform1,
    forecast,
  },
  data() {
    return {
      isFullScreen: false,
      activeClass: 3,
      itemList: [
        { name: "园区综合态势", link: "/home" },
        { name: "综合安防", link: "/Zhaf" },
        { name: "资产管理", link: "/Zcgl" },
        { name: "能耗管理", link: "/Nhgl" },
        { name: "环境监测", link: "/Hjjc" },
      ],
    };
  },
  methods: {
    getItem(index) {
      this.activeClass = index;
    },
    // toggleFullscreen() {
    //   if (this.isFullScreen) {
    //     this.exitFullScreen()
    //   } else {
    //     this.launchFullScreen(document.documentElement)
    //   }
    //   this.isFullScreen = !this.isFullScreen
    // },
    launchFullScreen(element) {
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
      } else if (element.webkitRequestFullscreen) {
        element.webkitRequestFullscreen();
      } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
      }
    },
    exitFullScreen() {
      if (document.exitFullscreen) {
        document.exitFullScreen();
      } else if (document.webkitExitFullscreen) {
        document.webkitExitFullscreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
      }
    },
  },
};
</script>
